package com.example.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.po.SysServer;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SysServerMapper extends BaseMapper<SysServer> {

    @Select("select * from sys_server where server_key =#{serverKey}")
    public SysServer getServer(@Param("serverKey") String serverKey);

    @Select("select id from sys_server")
    public List<Long> getAllServerKeys();

    @Select("select * from sys_server where is_master =1")
    public List<SysServer> getMasterSysServer();

    @Select("select * from sys_server where is_active =0")
    public List<SysServer> getStopServer();
}
